package entity.lianxi.demo03;

import entity.User;

import java.lang.reflect.Field;
import java.lang.reflect.Modifier;

public class MainTest03 {
    public static void main(String[] args) {
        Class<Integer> stu = Integer.class;
        Field[] fie = stu.getDeclaredFields();

        String integerName = stu.getSimpleName();
        String integerModifiers = Modifier.toString(stu.getModifiers());

        System.out.println(integerModifiers + " class " + integerName + "{");
        for (Field field : fie) {
            String fieldTypeName = field.getType().getSimpleName();
            int modifiers = field.getModifiers();
            String fieldModifier = Modifier.toString(modifiers);
            String fieldName = field.getName();
            System.out.println("\t" + fieldModifier + " " + fieldTypeName + " " + fieldName);
        }
        System.out.println("}");
    }
}
